package com.niit.session12;

public class Test {
	public static void main(String[] args) {
		Student student = new Student("小王",21);
		register(student);
		Teacher teacher = new Teacher("王建国",30);
		register(teacher);

	}
//	如果方法的形参是引用数据类型，就代表这个方法可以接收这个类型所有的子类
	public static void register(Person p) {
		p.show();
		
	}
}
